<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="author" content="LiuWeiLiang">
	<script language="javascript" src="../script/common.js" type="text/javascript"></script>
	<!--动态js-->
	<script language="javascript" type="text/javascript">
		var qt = {};				//数据表格对象
		//页面加载方法
		function load(){
			Eui.showNavigation();
			Common.initDict($('dcardform').statementType,"statement_type","请选择");
			setPages(["data1view","data2view"]);
		}
		//显示刷新方法
		function showData(){
			if(!checkForm(dcardform)) return;
			var data = Common.getValues(dcardform);
			var searchButton = dcardform.searchButton;
			DWR.call("txQueryService.getCompanyInfo",data.orgAccount,data.idno,function(v){
				var statementType= dcardform.statementType.value;
				if(statementType=="1"){
					createTable();
					qt.showTable();
				}else{
				 	_createTable();
					qt.showTable();
				}
			},{disCtrl:searchButton,loading:"data1list"});
		}
		//编辑
		function onEdit(id){
		   return;
		}
		//=================================================================================================
		//生成表格，创建QueryTable对象
		function createTable(){
			var columns = [													
				{title:"发出时间",width:"15%",render:dateForFunc},
				{title:"生成时间",width:"15%",render:dateForFunc},																				
				{title:"本期消费总金额",width:"15%"},										
				{title:"本期应还总金额",width:"15%"},
				{title:"操作",width:"15%",render:exportFunc},					//其他功能
				{title:"操作",width:"15%",render:opFunc}
			]
			qt = new QueryTable("billSql2","dcardform","data1list",columns,"data1view");
			switchPage("data1view");
		}
		//操作方法
		function exportFunc(r,v){
			return "<a href=# onclick=\"onEdit("+r[4]+");return false;\">导出帐单</a>"    
		}
		//操作方法
		function opFunc(r,v){
			return "<a href=# onclick=\"onEdit("+r[4]+");return false;\">补寄帐单</a>"    
		}
		
		//=================================================================================================
		//生成表格，创建QueryTable对象
		function _createTable(){
			var columns = [													//复选框
				{title:"交易日期",width:"17%",render:dateForFunc},
				{title:"卡号",width:"17%"},																				
				{title:"交易金额",width:"17%"},										
				{title:"交易类型",width:"17%"},
				{title:"交易地点",width:"15%"},
				{title:"操作员编号",width:"15%"}							//其他功能
			]
			qt = new QueryTable("billSql1","dcardform","data2list",columns,"data2view");
			switchPage("data2view");
		}
		function onCreate(){
			return;
		}
		function dateForFunc(v,r){
			var date = v.forMat(v);
			return "<a href=# onclick=\"onEdit("+r[4]+");return false;\">"+date+"</a>" 
		}
	</script>
</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
	<!--查询静态页面部分-->
	<div id="detview">
		<form id="dcardform" name="dcardform">	
			<div class="form">
				<div class="formTitle">帐单管理</div>
				<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="col2 label7">
					<tr>
						<td><label>帐户编号</label> <input name="orgAccount"  onblur="checkV(this,'',true)"><span class="red"> *</span></td>	
						<td><label>工商营业执照号</label> <input name="idno"  onblur="checkV(this,'',true)"><span class="red"> *</span></td>
					    <td><label>卡号</label> <input name="cardNumber" ></td>
					</tr>
					<tr>	
					    <td><label>帐单类型</label> <select name="statementType" onblur="checkV(this,'',true)"><option></option></select><span class="red"> *</span></td>	
						<td><button type="button" name="searchButton" onclick="showData()">查 询</button></td>
					</tr>
				</table>
			</div>
		</form>
	
	 <div id="data1view" style="display:none;">
		<div class="listBorder">
			<div class="listBar">
				<div class="listTitle">帐单数据列表</div>
		    </div>
				 <div id="data1list"></div>
		<!--查询结构列表-->
			   
	    </div>
	</div>
	<div id="data2view" style="display:none;">
		<div class="listBorder">
			<div class="listBar">
				<div class="listTitle">催款单数据列表</div>
				<p align="left"><button type="button" onclick="onCreate()">生成实时帐单</button></p>
		    </div>
				 <div id="data2list"></div>
		<!--查询结构列表-->
			   
	    </div>
	</div>
 </div>
</body>
</html>